const { decrypt } = require("./jwt");
const result = require("../model/result");
function checkJwt(token) {
  const tokenStatus = decrypt(token);
  if (tokenStatus.token) {
    return tokenStatus.info.username;
  } else {
    return new result([], "无效token", 400);
  }
}
module.exports = checkJwt;
